
package ficherosaleatorio;

import java.io.*;
import java.util.Scanner;

public class FicherosAleatorio 
{

    public static void main(String[] args) throws FileNotFoundException, IOException 
    {
        Scanner sc = new Scanner(System.in);
        char aux;
        
        RandomAccessFile aleatorio = new RandomAccessFile("personas.txt","rw");
        aleatorio.seek(aleatorio.length() / 2);
        
        System.out.println("Introduce lo que quieras");
        aux =sc.next().charAt(0);
        
        aleatorio.write(aux);
        
        System.out.println("Lectura: " + aleatorio.readLine().charAt(0));
        
        aleatorio.close();
    }
}
